﻿@using KRM.Core
@model IEnumerable<tblPromotion>
<table class="table table-bordered table-fix tbl-promotion tbl-selected" data-height="735">
    <thead>
        <tr>
            <th></th>
            <th>ID</th>
            <th>Promotion</th>
            <th>EndDate</th>
        </tr>
    </thead>
    <tbody>
        @foreach (var item in Model)
        {
            var value = 1;
            if (!item.Active) { value = -1; }
            else if (item.EndDate < DateTime.Now) { value = 0; }
            <tr onclick="promotionselected(@item.ID)" @(!item.Active ? "class=rownotarchived" : "")>
                <td>@value</td>
                <td>@item.ID</td>
                <td>@item.Name</td>
                <td>@item.EndDate</td>
            </tr>
        }
    </tbody>
</table>
